#include "Function.hpp"
#include "EquationSolver.hpp"
#include <iostream>
#include <cmath>

class F : public Function {
public:
    double operator() (double x) const {
        return tan(x) - x;
    }
    double derivative(double x) const {
		return 1/pow(cos(x),2) - 1;
	}
};

void solve_f(double x0) {
    std::cout << "Solving x = \\tan x near " << x0 << std::endl;
    Newton_Method solver_f(F(), x0);
    double x = solver_f.solve();
    std::cout << "A root is: " << x << std::endl;
}

int main(){
	solve_f(4.5);
	solve_f(7.7);
}
